<?php


namespace app\meetyou\controller;

use library\Controller;
use think\Db;

/**
 * 订单管理
 * Class Config
 * @package app\meetyou\controller
 */
class Order extends Controller {

    /**
     * 绑定数据表
     * @var string
     */
    protected $table = 'meetyou_order';

    /**
     * 订单概述
     * @auth true
     * @menu true
     * @throws \think\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @throws \think\exception\PDOException
     */
    public function index() {
        $this->title = '订单列表';
        $this->_query($this->table)->alias('o')
            ->leftJoin('meetyou_member m','m.id=o.mid')
            ->field('o.*,m.account,m.nickname,m.realname,m.phone,m.spare_phone,m.avatar')
            ->like('m.nickname#nickname,m.phone#phone')
            ->page();
    }

    private function orderData($status=0){
        $this->_query($this->table)->page();
    }

    public function status0() {
        $this->orderData();
    }
}